﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   assembly="Core"
                   namespace="Core.Model">
  <class name="Loja" table="LOJA">
    <id name="Id" column="LOJA_ID">
      <generator class="native">
        <param name="sequence">GEN_ID_LOJA</param>
      </generator>
    </id>
    <property name="DataCadastro" column="DATA_CADASTRO" not-null="true" />
    <many-to-one name="EmpresaEntity" column="EMPRESA_ID" cascade="save-update" not-null="true" />
    <property name="Nome" column="NOME" not-null="true" length="50" />
    <property name="Endereco" column="ENDERECO" length="80" />
    <property name="NumEndereco" column="NUM_ENDERECO" />
    <property name="NumCep" column="NUM_CEP" length="10" />
    <property name="Bairro" column="BAIRRO" length="60" />
    <property name="Complemento" column="COMPLEMENTO" length="40" />
    <many-to-one name="CidadeEntity" column="CIDADE_ID" cascade="save-update" not-null="true" />
    <many-to-one name="EstadoEntity" column="ESTADO_ID" cascade="save-update" not-null="true" />
    <property name="NumDdd" column="NUM_DDD_TELEFONE" length="2" />
    <property name="NumTelefone" column="NUM_TELEFONE" length="8" />
    <property name="NumDddFax" column="NUM_DDD_FAX" length="2" />
    <property name="NumFax" column="NUM_FAX" length="8" />
    <property name="NomeContato" column="NOME_CONTATO" length="60" />
    <property name="AtivoSN" column="ATIVO" not-null="true" />
    <bag name="Terminal" inverse="true" lazy="true" cascade="delete">
      <key column="LOJA_ID" />
      <one-to-many class="Core.Model.Terminal,Core" />
    </bag>
    <bag name="Usuario" inverse="true" lazy="true" cascade="delete">
      <key column="LOJA_ID" />
      <one-to-many class="Core.Model.Usuario,Core" />
    </bag>
  </class>
</hibernate-mapping>